package com.lwl.controller.sds;

import com.lwl.entity.LayData;
import com.lwl.entity.sds.TSdsRecordDetail;
import com.lwl.service.sds.TSdsRecordDetailService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * (TSdsRecordDetail)表控制层
 *
 * @author Lei
 * @since 2022-11-09 21:50:16
 */
@RestController
@RequestMapping("tSdsRecordDetail")
public class TSdsRecordDetailController {
    /**
     * 服务对象
     */
    @Autowired
    private TSdsRecordDetailService tSdsRecordDetailService;

    /**
     *  将前端页面传过来的题目答案信息转化为Javabean的形式，然后存储到做题记录中
     * @return
     */
    // @RequestBody 把json字符串转化为对象，只能放在形参前面
    @PostMapping("insertDetail")
    public LayData insertDetail(@RequestBody List<TSdsRecordDetail> details){

        return new LayData(tSdsRecordDetailService.insertDetails(details));
    }

}
